Tensorflow Installation

Zhiang Chen, June 2016

Tensorflow (CPU only, python3)


$ sudo apt-get update

$ sudo apt-get install python3-pip python3-dev libffi-dev

$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl

Test:

$ python3

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))

Other python packages

$ sudo apt-get install python3-matplotlib python3-numpy python3-scipy

$ sudo pip3 install -U scikit-learn

IPython notebook


$ sudo pip3 install jupyter

Test:

$ jupyter notebook

Create a new python3 notebook.

Run the code below in the cell:

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))

Tensorflow Sources

$ git clone --recurse-submodules https://github.com/tensorflow/tensorflow

Currently, Tensorflow has GPU allocation problems. It can be solved by using ‘BFC’ (Best-fit with coalescing), or manually allocating GPUs. Also see comments.


In [ ]: